<template>
 <div class="page-container">
     <div class="toolbar">
         <el-row>
             <el-tabs type="border-card">
                 <el-tab-pane label="基本信息">
                     <el-form :inline="true" :model="dataForm" label-width="120px" style="text-align:center;" ref="dataForm" :rules="dataFormRules" :disabled="this.$route.query.disabled" class="form">
                         <el-row style="margin-top: -20px;">
                             <el-divider content-position="center">
                                 <span style="font-size:16px;font-weight:800">基本信息</span>
                             </el-divider>
                             <el-row class="search-input">
                                 <el-form-item label="主键：" v-show="false">
                                     <el-input v-model="dataForm.id" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购单名称：">
                                     <el-input v-model="dataForm.name" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="合同编码：">
                                     <el-input v-model="dataForm.contractNo" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商家编码（采购单位）：" label-width="160px">
                                     <el-input v-model="dataForm.merchantCode" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商家名称：">
                                     <el-input v-model="dataForm.merchantName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="店铺编码：">
                                     <el-input v-model="dataForm.shopCode" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="店铺名称：">
                                     <el-input v-model="dataForm.shopName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购单号：">
                                     <el-input v-model="dataForm.code" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="供应商编码：">
                                     <el-input v-model="dataForm.supplierCode" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="供应商名称：">
                                     <el-input v-model="dataForm.supplierName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="仓库编码：">
                                     <el-input v-model="dataForm.storeCode" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="仓库名称：">
                                     <el-input v-model="dataForm.storeName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购数量：">
                                     <el-input v-model="dataForm.purchaseNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="交易币别,CNY-人民币;USD-美元....：" label-width="auto">
                                     <el-input v-model="dataForm.tradeCurrency" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商品计量单位：">
                                     <el-input v-model="dataForm.productUnit" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="对人命币汇率，精确到7位小数；如果值小于1，只存纯小数，不存带百分值,例如越南盾兑人民币，则存0.0003068；不允许存0.03068%的分子0.03068；" label-width="auto">
                                     <el-input v-model="dataForm.exchangeRate" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="含税金额；精确4位小数：" label-width="auto">
                                     <el-input v-model="dataForm.amountWithTax" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="未税采购价：">
                                     <el-input v-model="dataForm.amountWithoutTax" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购人编码：">
                                     <el-input v-model="dataForm.purchaseUserId" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购人名称：">
                                     <el-input v-model="dataForm.purchaseUserName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购单状态：0-待提交(初始值）；1-待审核（商家/店铺已提交，供应商未接单）；2-已审核(商家/店铺已提交，店铺已接单）；3-审核拒绝(商家/店铺已提交，供应商拒绝接单）；4-已发货(商家/店铺已提交，供应商已发货）；5-已结案(商家/店铺已提交，供应商已发货，商家/店铺已收货（已入库））；6-已过期(生效时间内，未到达已结案状态）；6-已作废(商家/店铺与供应商均作废；或者由运营平台判定作废）；" label-width="auto">
                                     <el-input v-model="dataForm.status" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="来源类型；目前字典项未知：" label-width="auto">
                                     <el-input v-model="dataForm.fromType" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="要货单号：">
                                     <el-input v-model="dataForm.deliveryCode" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购单生效开始时间：" label-width="auto">
                                     <el-input v-model="dataForm.startTime" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="采购单生效结束时间：" label-width="auto">
                                     <el-input v-model="dataForm.endTime" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="创建时间：">
                                     <el-input v-model="dataForm.createTime" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="修改时间：">
                                     <el-input v-model="dataForm.updateTime" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="创建人Id：">
                                     <el-input v-model="dataForm.creater" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="修改人Id：">
                                     <el-input v-model="dataForm.updaor" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="创建人姓名：">
                                     <el-input v-model="dataForm.createrName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="修改人姓名：">
                                     <el-input v-model="dataForm.updatorName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="实际发货量：">
                                     <el-input v-model="dataForm.realDeliveryNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="实际收货量：">
                                     <el-input v-model="dataForm.realRecievedNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商品编码：">
                                     <el-input v-model="dataForm.productCode" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商品名称：">
                                     <el-input v-model="dataForm.productName" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商品条码（条形码）：" label-width="auto">
                                     <el-input v-model="dataForm.productBarNo" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="商品规则：">
                                     <el-input v-model="dataForm.productSize" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="转换率：">
                                     <el-input v-model="dataForm.transferRate" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="税率：">
                                     <el-input v-model="dataForm.taxRate" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="起订量：">
                                     <el-input v-model="dataForm.minNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="最大定量：">
                                     <el-input v-model="dataForm.maxNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="运输方式（1-铁路；2-空运；3-公路；4-河运；5-海运；6-其他）" label-width="auto">
                                     <el-input v-model="dataForm.transportType" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="是否包邮：0-不含；1-包含：" label-width="auto">
                                     <el-input v-model="dataForm.hasTransportPrice" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="运费:">
                                     <el-input v-model="dataForm.transportPrice" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="">
                                     <el-input v-model="dataForm.originTaxRate" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="">
                                     <el-input v-model="dataForm.originAmountWithoutTax" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="">
                                     <el-input v-model="dataForm.originAmountWithTax" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="原起订量：">
                                     <el-input v-model="dataForm.originMinNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="原最大订货量：" label-width="auto">
                                     <el-input v-model="dataForm.originMaxNum" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="原运输方式（1-铁路；2-空运；3-公路；4-河运；5-海运；6-其他）：" label-width="auto">
                                     <el-input v-model="dataForm.originTransportType" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="原是否包含运费(0-不含；1-包含)：" label-width="auto">
                                     <el-input v-model="dataForm.originHasTransportPrice" placeholder="请输入"></el-input>
                                 </el-form-item>
                                 <el-form-item label="删除标志：0-未删除；1-已删除：" label-width="auto">
                                     <el-input v-model="dataForm.deleteFlag" placeholder="请输入"></el-input>
                                 </el-form-item>
                             </el-row>
                         </el-row>
                     </el-form>
                     <div class="tool-wrap">
                         <div class="left-area">
                             <el-row class="t_r el-button-group">
                                 <el-button-group>
                                     <el-button type="primary" size="small" @click="submitForm()" v-show="!this.$route.query.disabled">保存</el-button>
                                     <el-button type="primary" size="small" @click="$router.go(-1)">取消</el-button>
                                 </el-button-group>
                             </el-row>
                         </div>
                     </div>
                 </el-tab-pane>
             </el-tabs>
         </el-row>
     </div>
 </div>
</template>

<script>
//一.导包区
import jicTable from '@/components/jicComponentGallery/jicTable';
import {
    mapState
} from "vuex";
import ThemePicker from "@/components/ThemePicker";
import LangSelector from "@/components/LangSelector";
import VDistpicker from 'v-distpicker';
import elTree from '@/views/tree/src/tree.vue'

//二.数据输出区
export default {

    //2.1 注册组件
    components: {
        jicTable,
        ThemePicker,
        LangSelector,
        VDistpicker,
        elTree,
    },

    //2.2 数据初始化区
    data() {
        return {

            //2.2.1 公共数据初始化
            searchSize: 'mini',

            // 2.2.2 form 表单数据初始化 
            dataForm: {
                id: null,
                name: null,
                contractNo: null,
                merchantCode: null,
                merchantName: null,
                shopCode: null,
                shopName: null,
                code: null,
                supplierCode: null,
                supplierName: null,
                storeCode: null,
                storeName: null,
                purchaseNum: null,
                tradeCurrency: null,
                productUnit: null,
                exchangeRate: null,
                amountWithTax: null,
                amountWithoutTax: null,
                purchaseUserId: null,
                purchaseUserName: null,
                status: null,
                fromType: null,
                deliveryCode: null,
                startTime: null,
                endTime: null,
                createTime: null,
                updateTime: null,
                creator: null,
                updaor: null,
                createrName: null,
                updatorName: null,
                realDeliveryNum: null,
                realRecievedNum: null,
                productCode: null,
                productName: null,
                productBarNo: null,
                productSize: null,
                transferRate: null,
                taxRate: null,
                minNum: null,
                maxNum: null,
                transportType: null,
                hasTransportPrice: null,
                transportPrice: null,
                originTaxRate: null,
                originAmountWithoutTax: null,
                originAmountWithTax: null,
                originMinNum: null,
                originMaxNum: null,
                originTransportType: null,
                originHasTransportPrice: null,
                deleteFlag: null,
            },
            //trigger 为blur 表示丢失焦点;为change 表示值发生变化;
            dataFormRules: {
                id: [{
                        required: true,
                        message: "请输入主键",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                name: [{
                        required: true,
                        message: "请输入采购单名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                contractNo: [{
                        required: true,
                        message: "请输入合同编码",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                merchantCode: [{
                        required: true,
                        message: "请输入商家编码（采购单位）",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                merchantName: [{
                        required: true,
                        message: "请输入商家名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                shopCode: [{
                        required: true,
                        message: "请输入店铺编码",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                shopName: [{
                        required: true,
                        message: "请输入店铺名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                code: [{
                        required: true,
                        message: "请输入采购单号",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                supplierCode: [{
                        required: true,
                        message: "请输入供应商编码",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                supplierName: [{
                        required: true,
                        message: "请输入供应商名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                storeCode: [{
                        required: true,
                        message: "请输入仓库编码",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                storeName: [{
                        required: true,
                        message: "请输入仓库名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                purchaseNum: [{
                        required: true,
                        message: "请输入采购数量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                tradeCurrency: [{
                        required: true,
                        message: "请输入交易币别,CNY-人民币;USD-美元....",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                productUnit: [{
                        required: true,
                        message: "请输入商品计量单位",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                exchangeRate: [{
                        required: true,
                        message: "请输入对人命币汇率，精确到7位小数；如果值小于1，只存纯小数，不存带百分值,例如越南盾兑人民币，则存0.0003068；不允许存0.03068%的分子0.03068；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                amountWithTax: [{
                        required: true,
                        message: "请输入含税金额；精确4位小数；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                amountWithoutTax: [{
                        required: true,
                        message: "请输入未税采购价",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                purchaseUserId: [{
                        required: true,
                        message: "请输入采购人编码",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                purchaseUserName: [{
                        required: true,
                        message: "请输入采购人名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                status: [{
                        required: true,
                        message: "请输入采购单状态：0-待提交(初始值）；1-待审核（商家/店铺已提交，供应商未接单）；2-已审核(商家/店铺已提交，店铺已接单）；3-审核拒绝(商家/店铺已提交，供应商拒绝接单）；4-已发货(商家/店铺已提交，供应商已发货）；5-已结案(商家/店铺已提交，供应商已发货，商家/店铺已收货（已入库））；6-已过期(生效时间内，未到达已结案状态）；6-已作废(商家/店铺与供应商均作废；或者由运营平台判定作废）；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                fromType: [{
                        required: true,
                        message: "请输入来源类型；目前字典项未知；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                deliveryCode: [{
                        required: true,
                        message: "请输入要货单号",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                startTime: [{
                        required: true,
                        message: "请输入采购单生效开始时间；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                endTime: [{
                        required: true,
                        message: "请输入采购单生效结束时间；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                createTime: [{
                        required: true,
                        message: "请输入创建时间",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                updateTime: [{
                        required: true,
                        message: "请输入修改时间",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                creater: [{
                        required: true,
                        message: "请输入创建人Id",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                updaor: [{
                        required: true,
                        message: "请输入修改人Id",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                createrName: [{
                        required: true,
                        message: "请输入创建人姓名",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                updatorName: [{
                        required: true,
                        message: "请输入修改人姓名",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                realDeliveryNum: [{
                        required: true,
                        message: "请输入实际发货量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                realRecievedNum: [{
                        required: true,
                        message: "请输入实际收货量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                productCode: [{
                        required: true,
                        message: "请输入商品编码",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                productName: [{
                        required: true,
                        message: "请输入商品名称",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                productBarNo: [{
                        required: true,
                        message: "请输入商品条码（条形码）",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                productSize: [{
                        required: true,
                        message: "请输入商品规则",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                transferRate: [{
                        required: true,
                        message: "请输入转换率",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                taxRate: [{
                        required: true,
                        message: "请输入税率",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                minNum: [{
                        required: true,
                        message: "请输入起订量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                maxNum: [{
                        required: true,
                        message: "请输入最大定量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                transportType: [{
                        required: true,
                        message: "请输入运输方式（1-铁路；2-空运；3-公路；4-河运；5-海运；6-其他）",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                hasTransportPrice: [{
                        required: true,
                        message: "请输入是否包邮：0-不含；1-包含；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                transportPrice: [{
                        required: true,
                        message: "请输入运费",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originTaxRate: [{
                        required: true,
                        message: "请输入",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originAmountWithoutTax: [{
                        required: true,
                        message: "请输入",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originAmountWithTax: [{
                        required: true,
                        message: "请输入",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originMinNum: [{
                        required: true,
                        message: "请输入原起订量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originMaxNum: [{
                        required: true,
                        message: "请输入原最大订货量",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originTransportType: [{
                        required: true,
                        message: "请输入原运输方式（1-铁路；2-空运；3-公路；4-河运；5-海运；6-其他）",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                originHasTransportPrice: [{
                        required: true,
                        message: "请输入原是否包含运费(0-不含；1-包含)",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
                deleteFlag: [{
                        required: true,
                        message: "请输入删除标志：0-未删除；1-已删除；",
                        trigger: "blur"
                    },
                    {
                        min: 3,
                        max: 5,
                        message: "长度在 0 到 20 个字符",
                        trigger: "blur"
                    },
                ],
            },
            //dialogVisible: false, //// 是否显示弹窗内容;
            //editDialogVisible1: false,//// 是否可编辑弹窗内容;
            //editLoading: false,////是否显示加载时动画效果;

        } //return 完结;
    }, //data()方法 完结;

    //2.3 Vue 方法区
    methods: {
        //2.3.1 公共方法区

        //2.请求列表数据
        getDetail() {
            let this_ = this;
            if (this.$route.query != null && this.$route.query.id != null && this.$route.query.id != '' && this.$route.query.id != 'null' && this.$route.query.id != "undefined") {
                let params = {};
                params.id = this.$route.query.id;
                this.utils.request.getPurchaseOrderDetail(params, function (res) {
                    if (res.code === "0000") {
                        this_.dataForm = res.data;
                    } else {
                        this_.$message({
                            message: "操作失败, " + data.msg,
                            type: "error"
                        });
                    }
                });
            }
        },

        submitForm: function () {
            let this_ = this;
            this_.$refs.dataForm.validate(valid => {
                if (valid) {
                    this_.$confirm("确认提交吗？", "提示", {}).then(() => {
                        this_.editLoading = true;
                        let params = this.dataForm;
                        this_.utils.request.savePurchaseOrder(params, function (res) {
                            if (res.code === "0000") {
                                this_.$message({
                                    message: "操作成功",
                                    type: "success"
                                });
                            } else {
                                this_.$message({
                                    message: "操作失败",
                                    type: "error"
                                });
                            }
                        });
                        this_.$router.go(-1);
                    });
                }
            });
        },
        // 7.页面弹窗处理方法
        add() {
            this.dialogVisible = true;
        },

        // 8.关闭弹窗
        handleClose() {
            this.dialogVisible = false;
        },

        /*图片预览*/
        handlePictureCardPreview(file) {
            this.dialogImageUrl = file.url;
            this.dialogVisible = true;
        },
        /*图片移除*/
        handleRemove(file, fileList) {
            console.log(file, fileList);
        },
        back() {
            this.$router.go(-1);
        },
        //==========2.3.1 JavaScript 自定义方法区==========

    },
    //1.初始化页面调用方法(dom元素绑定后再执行初始化数据操作)
    mounted() {
        this.getDetail();
    },

}
</script>

<style lang="scss" scoped>
/* ele组件样式重置 */
.common-content {
    padding: 10px;
    box-sizing: border-box;

    .search-wrap /deep/ {
        .el-form-item__label {
            height: 32px;
            line-height: 32px;
        }

        .el-form-item__content {
            height: 32px;
            line-height: 32px;
            width: 150px;
        }

        .el-input--mini .el-input__inner {
            height: 32px;
            line-height: 32px;
        }

        .el-date-editor.el-input,
        .el-date-editor.el-input__inner {
            width: 150px;
        }
    }

    /* 多日期样式重置 */
    .el-dater /deep/ .el-form-item__content {
        width: 330px;
    }

    /* 通用工具部分样式 */
    .tool-wrap {
        width: 100%;
        height: auto;
        position: relative;
        overflow: hidden;

        .left-area {
            float: left;
            width: 50%;
            text-align: left;

            button {
                margin-right: 15px;
                border-radius: 5px;
            }
        }

        .right-area {
            float: right;
            width: 50%;
            text-align: right;
        }
    }

    /* 表格部分样式 */
    .table-wrap {
        width: 100%;
        max-height: 600px;
        margin-top: 20px;
    }

    /* 弹窗样式 */
    .dialog-wrap /deep/ .el-dialog__footer {
        text-align: center !important;
    }
}
</style>
